package com.example.laixunlong.control;

import android.os.Bundle;
import android.util.Log;
import android.view.View;

import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar;

import com.example.laixunlong.R;

public class Toolbar_dingbu extends AppCompatActivity
{
    Toolbar tb;
    Toolbar tb_2;
    @Override
    protected void onCreate(Bundle savedInstanceState)
    {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.toolbar_dingbu);

        tb= findViewById(R.id.tb);

        tb.setNavigationOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Log.e("提示信息", "返回键被点击了.");
            }
        });


        tb_2=findViewById(R.id.tb_2);
        tb_2.setTitle("通过java设置的标题");
        tb_2.setNavigationIcon(R.drawable.yqqs);

        tb_2.setNavigationOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {

            }
        });

    }

}
